package com.cspm.ahjy.bc.office.enums;

import org.springframework.util.StringUtils;

/**
 * 对齐方式枚举类
 * @author ServerZhang
 * @date 2017年10月17日
 */
public enum AlignEnum {

	LEFT("左对齐","left"),
	CENTER("居中对齐","center"),
	RIGHT("右对齐","right"),
	TOP("上对齐","top"),
	BOTTOM("下对齐","bottom"),
	DOUBLE("两端对齐","double"),
	DISTRIBUTE("分散对齐","distribute");
	
	String text;
	String value;
	
	private AlignEnum(String text, String value) {
		this.text = text;
		this.value = value;
	}
	
	public static AlignEnum getByValue(String value){
		if (StringUtils.isEmpty(value)) {
			return null;
		}
		AlignEnum[] values = AlignEnum.values();
		for(AlignEnum alignEnum : values){
			if (alignEnum.getValue().equals(value.toLowerCase())) {
				return alignEnum;
			}
		}
		return null;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
	
	
}
